package com.zd.kids.DataBean;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

/**
 * @ClassName: com.zd.kids.DataBean
 * @Description:
 * @Author: hyy
 * @Date: 2020/6/27
 * @Time: 4:25 PM
 */
public class TrainWordDataBean {

    /**
     * category_status : true
     * group_status : true
     * question_name : 我是誰
     * <p>
     * result : [{"title":"你好","pinyin":"nǐ hǎo","pinyin_grammar":"ni3 hao3","img_path":"","audio_path":"","newwordid":1},{"title":"我","pinyin":"wǒ","pinyin_grammar":"wo3","img_path":"","audio_path":"","newwordid":2},{"title":"名字","pinyin":"míng zì","pinyin_grammar":"ming2 zi4","img_path":"","audio_path":"","newwordid":3},{"title":"叫","pinyin":"jiào","pinyin_grammar":"jiao4","img_path":"","audio_path":"","newwordid":4},{"title":"歲","pinyin":"suì","pinyin_grammar":"sui4","img_path":"","audio_path":"","newwordid":5}]
     */

    private boolean group_status;
    private boolean category_status;
    private String question_name;
    private String question_img;
    private List<ResultBean> result;

    public boolean isGroup_status() {
        return group_status;
    }

    public void setGroup_status(boolean group_status) {
        this.group_status = group_status;
    }

    public boolean isCategory_status() {
        return category_status;
    }

    public void setCategory_status(boolean category_status) {
        this.category_status = category_status;
    }

    public String getQuestion_name() {

        return question_name == null ? "" : question_name;
    }

    public String getQuestion_img() {
        return question_img == null ? "" : question_img;
    }

    public void setQuestion_img(String question_img) {
        this.question_img = question_img;
    }

    public void setQuestion_name(String question_name) {
        this.question_name = question_name;
    }

    public List<ResultBean> getResult() {
        return result;
    }

    public void setResult(List<ResultBean> result) {
        this.result = result;
    }

    public static class ResultBean implements Serializable {
        /**
         * title : 你好
         * pinyin : nǐ hǎo
         * pinyin_grammar : ni3 hao3
         * img_path :
         * audio_path :
         * newwordid : 1
         */

        private String title;
        private List<String> title_list;
        private List<String> pinyin_list;
        private String pinyin;
        private String pinyin_grammar;
        private String img_path;
        private String audio_path;
        private int newwordid;

        public String getTitle() {
            return title;
        }

        public List<String> getWordTitles() {

            List<String> words = new ArrayList<>();

            if (title_list == null) {
                return words;
            }

            for (int i = 0; i < title_list.size(); i++) {
                StringBuilder stringBuilder = new StringBuilder();

                stringBuilder.append(title_list.get(i))
                        .append(",");

                if (pinyin_list.size() > i) {
                    stringBuilder.append(pinyin_list.get(i));
                }else {
                    stringBuilder.append(" ");
                }

                words.add(stringBuilder.toString());
            }

            return words;
        }

        public void setTitle(String title) {
            this.title = title;
        }


        public String getPinyin() {
            return pinyin;
        }

        public void setPinyin(String pinyin) {
            this.pinyin = pinyin;
        }

        public String getPinyin_grammar() {
            return pinyin_grammar;
        }

        public void setPinyin_grammar(String pinyin_grammar) {
            this.pinyin_grammar = pinyin_grammar;
        }

        public String getImg_path() {
            return img_path;
        }

        public void setImg_path(String img_path) {
            this.img_path = img_path;
        }

        public String getAudio_path() {
            return audio_path;
        }

        public void setAudio_path(String audio_path) {
            this.audio_path = audio_path;
        }

        public int getNewwordid() {
            return newwordid;
        }

        public void setNewwordid(int newwordid) {
            this.newwordid = newwordid;
        }
    }
}
